{template '_header'}
{if !empty($taskinfo)}
<script>document.title = "{$taskinfo['title']}"; </script>
<link rel="stylesheet" href="../addons/ewei_shopv2/plugin/task/static/style/common.css" />

<div class='fui-page  fui-page-current task-detail-page'>

    <div class="fui-content">
        <div class="detail-head">
            <img src="../addons/ewei_shopv2/plugin/task/static/images/detail-head.jpg" />
        </div>

        <div class="detail-list-title"><i class="icon icon-form"></i> {$taskinfo['title']}</div>
        <div class="detail-list">
            {if !empty($taskinfo['reward_data']) }
            {loop $taskinfo['reward_data'] $key $value}
            {if !empty($value)}
            <div class="list-item">
                <div class="inner">
                    <div class="basic">
                        <div class="name">{$rankinfo[$key]}</div>
                        <div class="desc">累计邀请{$value['needcount']}人扫描或关注海报</div>
                    </div>
                    <div class="reward">
                        {if isset($value['credit'])&&$value['credit']>0}
                        <div class="reward-item">
                            <div class="reward-info">积分奖励 <span>{$value['credit']}</span></div>
                            <div class="reward-btn disabled">{if $value['needcount']>$taskinfo['completecount']}领 取{else}已领取{/if}</div>
                        </div>
                        {/if}
                        {if isset($value['money'])&&$value['money']>0}
                        <div class="reward-item">
                            <div class="reward-info">金额奖励 <span>{$value['money']['num']}</span></div>
                            <div class="reward-btn disabled">{if $value['needcount']>$taskinfo['completecount']}领 取{else}已领取{/if}</div>
                        </div>
                        {/if}
                        {if isset($value['bribery'])&&$value['bribery']>0}
                        <div class="reward-item">
                            <div class="reward-info">红包奖励 <span>{$value['bribery']}</span></div>
                            <div class="reward-btn disabled">{if $value['needcount']>$taskinfo['completecount']}领 取{else}已领取{/if}</div>
                        </div>
                        {/if}
                        {if isset($value['coupon']['total'])&&$value['coupon']['total']>0}
                        <div class="reward-item">
                            <div class="reward-info">优惠券奖励 <span>{$value['coupon']['total']}</span></div>
                            <div class="reward-btn disabled">{if $value['needcount']>$taskinfo['completecount']}领 取{else}已领取{/if}</div>
                        </div>
                        {/if}
                        {if isset($value['goods'])&&count($value['goods'])>0}
                        <div class="reward-item">
                            <div class="reward-info">特价商品奖励 <span>{php echo count($value['goods']);}</span></div>
                            {if $value['needcount']>$taskinfo['completecount']}<div class="reward-btn disabled">领 取</div>{else}<a href="{php echo mobileUrl('task/goodslist',array('id'=>$taskinfo['join_id']),true);}"><div class="reward-btn ">领 取</div></a>{/if}
                        </div>
                        {/if}
                    </div>
                </div>
                {if $value['needcount']>$taskinfo['completecount']}
                <div class="status">
                    <div class="text">
                        <p>进</p>
                        <p>行</p>
                        <p>中</p>
                    </div>
                </div>
                {else}
                <div class="status red">
                    <div class="text">
                        <p>已</p>
                        <p>完</p>
                        <p>成</p>
                    </div>
                </div>
                {/if}
            </div>
            {else}
            <div class="list-item">
                <div class="inner">
                    <div class="basic">
                        <div class="name">{$rankinfo[1]}</div>
                        <div class="desc">无目标人数</div>
                    </div>
                    <div class="reward">
                        <div class="reward-item">
                            <div class="reward-info">无奖励</div>
                        </div>
                    </div>
                </div>
                <div class="status">
                    <div class="text">
                        <p>无</p>
                        <p>效</p>
                    </div>
                </div>
            </div>
            {/if}
            {/loop}
            {else}
            <div class="list-item">
               <p class="text-center">无奖励</p>
            </div>
            {/if}
        </div>

        <div class="detail-list-title"><i class="icon icon-information"></i> 注意事项</div>

        <div class="detail-text">{if !empty($res['taskinfo'])}{php $taskinfo = unserialize($res['taskinfo']); echo htmlspecialchars_decode($taskinfo);}{else}暂无说明{/if}</div>

    </div>

</div>
{else}
<script>document.title = '未查到此任务信息'; </script>
<div class='fui-page  fui-page-current'>
    <div class="fui-content ">
        <h3 class="text-center">未查到任务信息</h3>
    </div>
</div>
{/if}

{template '_footer'}